package com.settlement.system.service;

import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.TblNcVurcherDetail;
import com.settlement.system.model.entity.common.TblNcVurcherDetailPlus;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * NC凭证明细_优化 服务类
 * @author xiaochuan
 * @since 2021-01-20
 */

public interface ITblNcVurcherDetailPlusService extends IBaseService {

    /**
     * 获取合计
     *
     * @param params 请求参数
     * @return
     * @throws ServiceException
     */
    public TblNcVurcherDetailPlus getFoot(Map<String, Object> params) throws ServiceException;

    /**
     * 撤销NC
     *
     * @param params
     * @return
     * @throws ServiceException
     */
    public String revokeNc(Map<String, Object> params) throws ServiceException;

    /**
     * 校验推送NC的数据是否可以正常推送
     * @param params 参数
     * @return 校验结果
     */
    String checkPush(Map<String, Object> params) throws ServiceException;

    /**
     * 推送NC凭证
     * @param params 参数
     * @return 推送结果
     */
    String pushNc(Map<String, Object> params);

    /**
     * 根据业务单号跟新
     * @param vurcherDetail 凭证明细
     */
    void updateByOrderNo(TblNcVurcherDetailPlus vurcherDetail);

    void updateBySerialNo(TblNcVurcherDetailPlus vurcherDetail);

    /**
     * 把返回的凭证号回写到费用分摊表
     * @param ncVoucherNo
     * @param orderNo
     */
    void updateNcVoucherNoBySerialNo(String ncVoucherNo, String orderNo);

    void updateAccountStatusOfCostAllocationBySerialNo(String serialNo, String toAccountStatus, String accountFailDesc);

    void updateAccountStatusOfUnificationSummaryBySerialNo(String serialNo, String toAccountStatus, String accountFailDesc);

    /**
     * 撤销推送NC
     * @param params 参数
     * @return 结果
     */
    String deletePushNc(Map<String, Object> params) throws ServiceException;

    String doDeletePushNc(List<TblNcVurcherDetailPlus> detailPlusList, String editorNo);
    /**
     * 更新凭证号
     * @param params 参数
     */
    void updateNcVoucherNo(Map<String, Object> params);

    /**
     * 附件归集
     * @param params 参数
     */
    void annexCol(Map<String, Object> params);
}

